Repository navigation
fix(inspect): ignore non-package top-level dirs in sdist site_paths - #372
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After #364 (
840b79e),_resolve_top_level_pathskeeps every file in namespace directories (so data files in wheels likePyQt5-Qt5'sPyQt5/Qt5/qml/**are linked in venvs). However, sdist inspection feeds_resolve_top_level_pathsevery top-level directory in the sdist, causing non-package top-level directories without any Python modules (such as.github/,requirements/, orlicenses/) to resolve to file lists and create dangling symlinks undervenvs_site_packages=yes.Filter
top_level_dirsin_find_site_paths_from_items(sdist path only) to valid Python identifiers that contain at least one Python module (_extract_module_name) at any depth. Bothtop_level.txtand wheel inspection (_find_wheel_paths) remain unchanged, and data files inside sdist namespace directories that also contain Python modules are still preserved.Test Plan
tests/unit/inspect_package_test.py(test_sdist_ignores_non_package_top_level_dirsandtest_sdist_namespace_keeps_data_files_when_python_present).tests/e2e/requirements(packaging-23.2sdistsite_pathsreturns["noxfile.py", "packaging", "tasks"]) andtests/e2e/namespace_pkgs.